<template>
    <div>

        <template>
            <!--            标题-->
            <el-row class=" border_bottom" type="flex" justify="start">
                <el-col :span="2">
                    <h3> 收货地址</h3>
                </el-col>
            </el-row>
            <el-table
                    :data="addressList"
                    style="width: 100%">
                <el-table-column
                        prop="addressName"
                        label="姓名"
                        width="380">
                </el-table-column>
                <el-table-column
                        prop="addressPhone"
                        label="手机号码"
                        width="380">
                </el-table-column>
                <el-table-column
                        prop="addressContent"
                        label="收货地址">
                </el-table-column>
            </el-table>
        </template>

    </div>
</template>
<script>
    export default {
        name: "ShippingAdderss",
        data() {
            return {
                memberName: '',
                memberPhone: '',
                addressList: [],
                multipleSelection: [],
                currentPage1: 5,
                currentPage2: 5,
                currentPage3: 5,
                currentPage4: 4
            }
        },
        methods: {
            toggleSelection(rows) {
                if (rows) {
                    rows.forEach(row => {
                        this.$refs.multipleTable.toggleRowSelection(row);
                    });
                } else {
                    this.$refs.multipleTable.clearSelection();
                }
            },
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            }
        },
        created() {


            this.currentSearchId = Number.parseInt(sessionStorage.getItem('currentSearchId'));
            console.log('当前获得的id：'+ this.currentSearchId)
            //发起请求
            this.$axios.post('/api/user/getUserAddress?userId='+this.currentSearchId).then((res)=>{
                this.addressList=res.data.data
                console.log(res.data.data)
            })


        }
    }
</script>

<style scoped>

    .b1 {
        border: 1px solid red;
    }

    .b2 {
        border: 1px solid blue;
    }

    .border_bottom {

        border-bottom: 1px solid grey;
    }

    .el-input {
        display: inline-block;
    }

    span {
        margin-top: 20px;
    }

    .middle {
        align-items: center;
    }
</style>